package model

import (
	"gorm.io/gorm"
	"time"
)

type TestQuestions struct {
	Id                uint           `gorm:"column:id;type:bigint UNSIGNED;primaryKey;not null;" json:"id"`
	TestPaperId       uint           `gorm:"column:test_paper_id;type:bigint;not null;" json:"test_paper_id"`
	Topic             string         `gorm:"column:topic;type:varchar(255);not null;" json:"topic"`
	QuestionType      string         `gorm:"column:question_type;type:varchar(255);not null;" json:"question_type"`
	Difficulty        uint           `gorm:"column:difficulty;type:tinyint(1);comment:1 低 2 中 3 高;not null;" json:"difficulty"` // 1 低 2 中 3 高
	Keysword          string         `gorm:"column:keysword;type:varchar(20);not null;" json:"keysword"`
	ProfessionalScope string         `gorm:"column:professional_scope;type:varchar(11);not null;" json:"professional_scope"`
	Option            uint           `gorm:"column:option;type:tinyint;comment:1 a 2b 3c 4 d;default:NULL;" json:"option"` // 1 a 2b 3c 4 d
	Answer            uint           `gorm:"column:answer;type:tinyint;comment:1 a 2b 3c 4 d;default:NULL;" json:"answer"` // 1 a 2b 3c 4 d
	OptionScore       uint           `gorm:"column:option_score;type:tinyint;default:NULL;" json:"option_score"`
	CreatedAt         time.Time      `gorm:"column:created_at;type:datetime(3);default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdateAt          time.Time      `gorm:"column:update_at;type:datetime(3);default:CURRENT_TIMESTAMP(3);" json:"update_at"`
	DeleteAt          gorm.DeletedAt `gorm:"column:delete_at;type:datetime(3);default:NULL;" json:"delete_at"`
}

func (t *TestQuestions) TableName() string {
	return "test_questions"
}
